import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    // mode: 'history',
    routes: [
        {
            path: '/',
            redirect: '/user'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/home',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../page/home/index.vue'),
                    meta: { title: '工单信息' }
                },
                {
                    path: '/orderDetails',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../page/orderDetails/index.vue'),
                    meta: { title: '工单信息' }
                },
                {
                    path: '/news',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../page/news/index.vue'),
                    meta: { title: '新闻' }
                },
                {
                    path: '/newNews',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../page/news/newNews.vue'),
                    meta: { title: '创建新闻' }
                },
                {
                    path: '/newsDetails',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../page/news/newsDetails.vue'),
                    meta: { title: '新闻详情' }
                },
                {
                    path: '/newsEstablish',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../page/newsEstablish/index.vue'),
                    meta: { title: '新闻新建' }
                },
                {
                    path: '/newsEstablishNewNews',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../page/newsEstablish/newNews.vue'),
                    meta: { title: '创建新闻' }
                },
                {
                    path: '/newsAudit',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../page/newsAudit/index.vue'),
                    meta: { title: '新闻管理' }
                },
                {
                    path: '/comments',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../page/comments/index.vue'),
                    meta: { title: '评论管理' }
                },
                {
                    path: '/management',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../page/management/index.vue'),
                    meta: { title: '权限管理' }
                }
            ]
        },
        {
            path: '/user',
            component: () => import(/* webpackChunkName: "login" */ '../page/user/index.vue'),
            meta: { title: '登录' }
        },
        {
          path: '/details',
          component: () => import(/* webpackChunkName: "dashboard" */ '../page/user/details.vue'),
          meta: { title: '新闻详情' }
        },
    ]
});
